<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>MSc Dissertation: linear_regression.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">MSc Dissertation
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">linear_regression.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="linear__regression_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#ifndef LINEARREGRESSION_H</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define LINEARREGRESSION_H</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;selforg/matrix.h&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="keyword">using namespace </span>matrix;</div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="code" href="classLinearRegression.html">   21</a></span>&#160;<span class="keyword">class </span><a class="code" href="classLinearRegression.html">LinearRegression</a> {</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <a class="code" href="classLinearRegression.html">LinearRegression</a>(<span class="keywordtype">int</span> numSensors, <span class="keywordtype">int</span> numMotors);</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    </div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classLinearRegression.html">LinearRegression</a>();</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordtype">void</span> setDesiredOut(Matrix sensors);</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    </div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keywordtype">void</span> setState(Matrix motors);</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    </div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    Matrix predict();</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    </div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    Matrix getModelMatrix ( Matrix inputs);</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keywordtype">void</span> updateWeights();</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    </div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="code" href="classLinearRegression.html#aa1c2a397b9d243bd63998eab08e952ab">   79</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classLinearRegression.html#aa1c2a397b9d243bd63998eab08e952ab">inputNum</a>;            </div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="code" href="classLinearRegression.html#ac0ae52ea38fd61019d6d94845229a6f2">   80</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classLinearRegression.html#ac0ae52ea38fd61019d6d94845229a6f2">outputNum</a>;           </div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="code" href="classLinearRegression.html#aa783c40e02b8661f494c20ec8c724ca6">   81</a></span>&#160;    <span class="keywordtype">double</span> <a class="code" href="classLinearRegression.html#aa783c40e02b8661f494c20ec8c724ca6">forgettFactor</a>;    </div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="code" href="classLinearRegression.html#a732cefc5759ef27e2ddacda4bed7e652">   82</a></span>&#160;    Matrix <a class="code" href="classLinearRegression.html#a732cefc5759ef27e2ddacda4bed7e652">predictedOut</a>;     </div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="code" href="classLinearRegression.html#a06b23260af70aa7491394b081230c538">   83</a></span>&#160;    Matrix <a class="code" href="classLinearRegression.html#a06b23260af70aa7491394b081230c538">invCorrelation</a>;   </div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="classLinearRegression.html#aacbab3190af48c974ef498394a206ec4">   84</a></span>&#160;    Matrix <a class="code" href="classLinearRegression.html#aacbab3190af48c974ef498394a206ec4">inputs</a>;           </div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="code" href="classLinearRegression.html#a47d66c19a4d50116875969be51248a6c">   85</a></span>&#160;    Matrix <a class="code" href="classLinearRegression.html#a47d66c19a4d50116875969be51248a6c">regression_coeff</a>; </div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="classLinearRegression.html#a4955fea50332c1e52dff369a0ba9f1a0">   86</a></span>&#160;    Matrix <a class="code" href="classLinearRegression.html#a4955fea50332c1e52dff369a0ba9f1a0">desiredOut</a>;       </div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="classLinearRegression.html#aabe743e668a3ae0d82f2da8978deb186">   87</a></span>&#160;    Matrix <a class="code" href="classLinearRegression.html#aabe743e668a3ae0d82f2da8978deb186">error</a>;            </div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;};</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor">#endif  </span><span class="comment">/* LINEAR_REGRESSION_H */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Aug 14 2013 17:48:49 for MSc Dissertation by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>
